package org.hry.socket.bio.longlink;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.TimeUnit;

public class HeadFlagSocketClient {
    public static void main(String[] args) throws IOException, InterruptedException {
        Socket socket = new Socket("localhost", 8888);
        OutputStream out = socket.getOutputStream();
        while (true) {
            TimeUnit.SECONDS.sleep(2);
            out.write("0018今天天气不错0018亲爱的小猴子0015老虎一声吼".getBytes(StandardCharsets.UTF_8));
        }
    }
}
